
import java.util.LinkedList;
import java.util.List;

import play.test.*;
import models.*;


import org.junit.*;

import controllers.UserStories;
public class getAllUserStories extends UnitTest{

	@Test
	public void fetchAndCheck(){
		Project p1=new Project("Test project",50,true,"test test test test").save();
    	User Salem=new User("salem", "sayed", "abdel gawad", "salemsayed", "123", "salemsayed@gmail.com",
    			"0101420501","84 bla","Cairo","Egypt","").save();
    	
    	Component comp1=new Component("c3","User Stories",p1).save();
    	new UserStory("Story", 50 , "High", comp1, Salem, null, null).save();
		List<UserStory>output=new LinkedList<UserStory>();
		output=UserStories.getAllUserStories(p1);
		assertEquals(1,output.size());
	}
}
